import {request} from 'umi'

// 获取文章列表
export function getArticleList(page=1, pageSize=12, status='publish'){
    return request('/api/article', {
        params: {
            page,
            pageSize,
            status
        }
    })
}

// 顶部推荐
export function getArticleAllRecommend(){
    return request('/api/article/all/recommend')
}

// 侧边栏推荐
export function getArticleRecommend(){
    return request('/api/article/recommend')
}

// 归档列表
export function getArchives(){
    return request('/api/article/archives')
}

// 归档文章详情
export function getArticleById(id:string){
  return request( `/api/article/${id}`)
}

// 点击文章分类
export function getArticleCategory(value:string,pagesize:number){
    return request(`/api/article/category/${value}`,{method:"GET",params:{page:1,pagesize,status:"publish"}})
}